using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebFoundation.Data;
using MHI.InspectionManager.Interfaces; 

namespace MHI.InspectionManager.Data
{
	/// <summary>
	/// DevJobpersonsT,table items:dev_jobpersons_t 
	/// </summary>
	internal class DevJobpersonsTQueryDAO : QueriableDAO<DevJobpersonsT> 
	{
		protected static DbManager _dbManager = DbManager.FromConfig("DefaultConnection");

		public DevJobpersonsTQueryDAO()
		: base(_dbManager)
		{
		}

		public DevJobpersonsTQueryDAO(DbManager db)
		: base(db)
		{
		}

		/// <summary>
		/// 获取所有DevJobpersonsT,table items:dev_jobpersons_t信息 
		/// </summary>
		/// <returns></returns>
		public IEnumerable<DevJobpersonsT> GetDevJobpersonsTAllItems()
		{
			var query = this.CreateQuery();
			query.Filter().Eq(r => r.IsUse, 1);
			return this.Query(query);
		}

		/// <summary>
		/// 根据id，获取所有DevJobpersonsT,table items:dev_jobpersons_t信息 
		/// </summary>
		/// <returns></returns>
		public IEnumerable<DevJobpersonsT> GetDevJobpersonsTItemsById(int id)
		{
			var query = this.CreateQuery();
			query.Filter().Eq(r => r.Id, id);
			return this.Query(query);
		}

	}
}
